package com.foo;

public class Triangle extends BaseGraphic{

	private final int width;
	private final int height;
	
	
	
	public Triangle(int width, int height, int x, int y) {
		this.setLocation(new Point(x,y));
		
		this.width = width;
		this.height = height;
	}
	
	public int getWidth() {
		return width;
	}
	public int getHeight() {
		return height;
	}
	
	@Override
	public void draw() {
		System.out.println("Drawing " + this.toString());
	}
	@Override
	public double getArea() {
		return 0.5 * this.width * this.height;
	}
	@Override
	public String toString() {
		return "Triangle [width=" + width + ", height=" + height + "]";
	}
	
	
}
